<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include  file="/common/mytags.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绿网供应商协同 - 登录</title>
    <%@ include file="/common/common_h.jsp" %>
    <link href="${basePath }common/hplus/css/login.min.css" rel="stylesheet">
    <script type="text/javascript">
    if (window != top){ 
      alert("当前登录信息已失效，请重新登录");
      {top.location.href = window.location.href='${basePath}';}
 	}
    function login(){
    	if($("#userName").val().trim()==""){
    		$("#errorInfo").text("请输入用户名");
    		return;
    	}
    	if($("#password").val().trim()==""){
    		$("#errorInfo").text("请输入密码");
    		return;
    	}
    	$("#errorInfo").text("");
    	openLoading();
    	$.ajax({
			type:"post",
			url:_BASEPATH+"supplier/login.shtml",
			data:$("#login-form").serialize(),
			dataType:"JSON",
			success:function(res){
				closeLoading();
				if(res.success){
					forward("frame.shtml");
				}else{
					$("#errorInfo").text(res.msg);
				}
			}
		});
    }
    function IsEnterKeyPress(){
		var lKeyCode = (navigator.appname=="Netscape")?event.which:window.event.keyCode;
    	if ( lKeyCode == 13 ){
    		login();
		}
	
	}
    </script>
</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1></h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>绿网供应商协同</strong></h4>
                    <ul class="m-b">
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 采购订单</li>
                    </ul>
                </div>
            </div>
            <div class="col-sm-5">
                <form id="login-form">
                    <h4 class="no-margins">登录：</h4>
                    <input type="text" id="userName" name="userName" class="form-control uname" placeholder="用户名" onKeyPress="IsEnterKeyPress()"/>
                    <input type="password" id="password" name="password" class="form-control pword m-b" placeholder="密码" onKeyPress="IsEnterKeyPress()"/>
                    <span id="errorInfo" style="color: #cc0000"></span>
                    <button onclick="login()" type="button" class="btn btn-success btn-block">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 2018 All Rights Reserved. 
            </div>
        </div>
    </div>
</body>

</html>
